<div class="tab-pane active" id="query-1">
    <div class="inbox-detail">
        <h3>Contact  Admin</h3>
        <hr>
        <b>SUBJECT: </b><small>Contact admin</small>
        <hr> <div class="main-review">
            <?php
            if (!empty($dataByUser)) {
                //echo count($dataByUser);die;
                foreach ($dataByUser as $userDetail) {
                    if ($userDetail->mail_from != 1) {
                        $trainer = Users::getFrontEndUser($userDetail->from_users_id);
                        $trainerName = (!empty($trainer->first_name) ? $trainer->first_name : $trainer->user->username);
                        $imgsrc = (!empty($trainer->photo)) ? getRequestbaseUrl() . getuploadFolderDir() . $userDetail->from_users_id . '/profile/minithumb/' . $trainer->photo : getWorkNoshopimage(SkillConfig::skill_myinbox_image);
                    } else {
                        $imgsrc = (!empty($adminuser->photo)) ? getRequestbaseUrl() .getuploadFolderDir().'backend/' . SkillConfig::ADMIN_ID . '/profile/minithumb/' . $adminuser->photo : getWorkNoshopimage(SkillConfig::skill_myinbox_image);
                        $trainerName = Users::getBackEndUser($userDetail->backend_user_id);
                        $trainerName = $trainerName->first_name;
                    }
                    ?>


                    <div class="inbox-review">
                        <a href="#">
                            <img src="<?php echo $imgsrc; ?>" alt="">
                            <div class="review-info">
                                <div class="name"><span><?php echo $trainerName; ?>  | </span><?php echo date("D, d M Y", convert_datetime($userDetail->created)) ?>
                                </div>
                                <div class="title"><?php echo $userDetail->query; ?></div>
                            </div>
                        </a>
                    </div><!--query-review--> 
                <?php }
                ?></div>

            <div class="query-reply">
                <textarea placeholder="write a reply..." class="form-control book-control" id="reply-to-admin"></textarea>
                <div  class="errorMessage" id="errorMessage_msg_adminid"></div>
            </div>
            <div class="checkbox choice">
                <div id="conatctTOadminloder" style="display: none;float:left;"><img src="<?php echo ThemePath(); ?>/images/myskill.gif"></img></div>  <input type="submit" value="submit" onclick="return replyAMailToUserAdmin()"/>
            </div> <?php
        } else {
            echo 'No conversations yet.';
            ?>
        </div>
            <div class="query-reply">
                <textarea placeholder="write a reply..." class="form-control book-control" id="reply-to-admin"></textarea>
                <div  class="errorMessage" id="errorMessage_msg_adminid"></div>
            </div>
            <div class="checkbox choice">
                <div id="conatctTOadminloder" style="display: none;float:left;"><img src="<?php echo ThemePath(); ?>/images/myskill.gif"></img></div>  <input type="submit" value="submit" onclick="return replyAMailToUserAdmin()"/>
            </div>
        <?php }
        ?>

    </div>
</div>